const JwtStrategy = require('passport-jwt').Strategy,
      ExtractJwt = require('passport-jwt').ExtractJwt;

//配置信息
const opts = {}
opts.jwtFromRequest = ExtractJwt.fromAuthHeaderAsBearerToken();
opts.secretOrKey = 'aiProject';  //加密名字

module.exports = passport => {
  passport.use(new JwtStrategy(opts, (jwt_payload, done) => {
    return done(null,jwt_payload)
  }));
}